#!/bin/bash

RUN_LOG_FILENAME=./server/log/run.log
DATE_FORMAT="[%Y-%m-%d %H:%M:%S %z]"

function log_info() {
    echo $(date +"$DATE_FORMAT")"[INFO](log_packer):" $1 >> $RUN_LOG_FILENAME
}

./stop_server.sh

log_info "Stop for packing log."
xz $RUN_LOG_FILENAME
mv $RUN_LOG_FILENAME.xz ./server/log/"$(date +"%Y-%m-%d_%H:%M:%S_%z").log.xz"

./run_server.sh